home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol E-12 / Vol E-12.iso / games / barbie / barbi000.swf / scripts / frame_3 / PlaceObject2_112_32 / CLIPACTIONRECORD onClipEvent(keyDown).as next >
Text File  |  2012-05-21  |  924b  |  38 lines

  1. onClipEvent(keyDown){
  2.    if(Key.getCode() == Key.LEFT || Key.getCode() == Key.RIGHT || Key.getCode() == Key.UP)
  3.    {
  4.       if(_root.life == 0)
  5.       {
  6.          if(_root.reset == 0)
  7.          {
  8.             _root.reset = 1;
  9.             if(Key.getCode() == Key.LEFT)
  10.             {
  11.                _root.dir -= 1;
  12.                if(_root.dir < 1)
  13.                {
  14.                   _root.dir += 4;
  15.                }
  16.                _root.direction();
  17.             }
  18.             if(Key.getCode() == Key.RIGHT)
  19.             {
  20.                _root.dir += 1;
  21.                if(4 < _root.dir)
  22.                {
  23.                   _root.dir -= 4;
  24.                }
  25.                _root.direction();
  26.             }
  27.             if(Key.getCode() == Key.UP)
  28.             {
  29.                _root.move();
  30.             }
  31.             if(Key.getCode() == Key.DOWN)
  32.             {
  33.             }
  34.          }
  35.       }
  36.    }
  37. }
  38.